﻿using Common.Communication;
using Common.Device.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Device.Interfaces
{
    public interface ITongXin : IDevice
    {
        /// <summary>
        /// 发送数据
        /// </summary>
        /// <param name="type">数据类型</param>
        /// <param name="buffer">发送内容</param>
        /// <returns></returns>
        Result Send(TongXinEnum.DataType type, string buffer);
        /// <summary>
        /// 接收数据
        /// </summary>
        /// <param name="type">数据类型</param>
        /// <param name="waitTime">等待时间</param>
        /// <returns></returns>
        Result<byte[]> Receive(TongXinEnum.DataType type, int waitTime);
        /// <summary>
        /// 发送并接收数据
        /// </summary>
        /// <param name="type">数据类型</param>
        /// <param name="buffer">发送数据</param>
        /// <param name="waitTime">等待时间</param>
        /// <returns></returns>
        Result<byte[]> SendAndReceive(TongXinEnum.DataType type, string buffer, int waitTime);
    }
}
